<!DOCTYPE html>
<html>
<head>
    <title>样式定位</title>
<style type="text/css">
    .s{
        width: 200px;
        height: 200px;
        background-color: #EEE685;
        margin: 30px 30px;
    }
    .s1{
        height: 100px;
        width: 100px;
        background-color: #E3E3E3;
        position: absolute;
        top:50px;
        left: 50px;
    }
    .s2{
        background-color: #AEEEEE;
        height: 50px;
        width: 50px;
        position:relative;
        top:15px;
        left: 15px;
    }
</style>
</head>
<body>
<div class="s">
<div class="s1">
<div class="s2"></div>
</div>
</div>
</body>
</html>